﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
   <base href="<%=basePath %>">
    <title>员工管理</title>
    <script language="javascript" type="text/javascript" src="<%=basePath %>Attendance/js/jquery-1.4.2.min.js"></script>
	<link rel="stylesheet" type="text/css" href="<%=basePath %>Attendance/css/show.css">
	<script type="text/javascript">
	 $(document).ready(
		 function(){ 
		  $(".datatable tr").mouseover(function(){$(this).addClass("over");}).mouseout(function(){$(this).removeClass("over");}) 
	 	  $(".datatable tr:even").addClass("alt"); 
        }); 
    </script>
    <script type="text/javascript">
		function reloadGo() {
		var txtCurrentPage = document.getElementById("txtCurrentPage").value;
		var type = "^\\d+$";
		var re = new RegExp(type);
		if (txtCurrentPage.match(re) == null) {
			document.getElementById("txtCurrentPage").value="";
			alert("请输入整数!");
			return;
		}
		
		window.location.href = "ShowUserServlet?pagerMethod=go&currentPage=" + txtCurrentPage;
	}
	</script>
    <script language="javascript" type="text/javascript">
    function hilite(obj) {
    obj.style.border = '2px solid #000000';
    }
    function delite(obj) {
    obj.style.border = '2px solid #ffffff';
    }
    </script>
  </head>
  
  <body>
    <div>
   	    <table summary="Employee" class="datatable" align="center">
		    <caption>Employee List</caption>
		    <tr>
		    <th width="14%" scope="col">姓  名</th>
		    <th width="11%" scope="col">性  别</th>
		    <th width="15%" scope="col">考勤编号</th>
		    <th width="11%" scope="col">校  区</th>
		    <th width="11%" scope="col">部  门</th>
            <th width="11%" scope="col">职  位</th>
		    <th width="10%" scope="col">OAID</th>
            <th width="17%" scope="col" style="text-align: center;">操  作</th>
		    </tr>
		    <c:forEach items="${userlist}" var="userlist">
		    <tr>
		    <td>${userlist.name}</td>
		    <td>${userlist.gender}</td>
		    <td>${userlist.badgenumber}</td>
		    <td>${userlist.schId}</td>
		    <td>${userlist.subdept}</td>
            <td>${userlist.postId}</td>
		    <td>${userlist.oaId}</td>
	     <td align="center"><a href="UpUserServlet?userID=${userlist.userId}">
            <c:choose>
            	<c:when test="${userlist.status==1}"><a href="UpUserServlet?userID=${userlist.userId}"><img src="<%=basePath %>Attendance/images/okay.png" border="0" width="16" height="16" title="在职，点击修改！"></a></c:when>
            	<c:when test="${userlist.status==0}"><a href="UpRemoveServlet?userID=${userlist.userId}"><img src="<%=basePath %>Attendance/images/remove.png" border="0" width="16" height="16" title="离职，点击修改！"></a></c:when>	
            </c:choose>&nbsp;&nbsp;<img src="<%=basePath %>Attendance/images/edit.png" border="0" width="16" height="16" title="点击编辑！">
            </td>
		    </tr>
            </c:forEach>
		    <tr>
		    <th colspan="4" align="left">&nbsp;&nbsp;共<font color="#FF0000">${page.totalRows}</font>条信息 每页显示<font color="#FF0000">${page.pageSize}</font>条  第<font color="#0066FF">${page.currentPage}</font>页/共<font color="#0066FF">${page.totalPages}</font>页</th>
		    <th colspan="4" style="text-align: right;"><c:choose>
							<c:when test="${page.currentPage==1&&page.totalPages==1}"><font color="#999999">首页--上一页--下一页--尾页--转到</font>
	     <input type="text" disabled id="txtCurrentPage" size="3"><font color="#999999">页</font><input type="button" value="Go" ></c:when>
							<c:otherwise><a href="ShowUserServlet?pagerMethod=first">首页</a>--
							<a href="ShowUserServlet?pagerMethod=previous&currentPage=${page.currentPage}"><font color="#003399">上一页</font></a>--
							<a href="ShowUserServlet?pagerMethod=next&currentPage=${page.currentPage}"><font color="#003399">下一页</font></a>--
							<a href="ShowUserServlet?pagerMethod=last">尾页</a>--转到
		<input type="text"  title="请输入整数哦！" size="3" id="txtCurrentPage">页<input type="button" value="Go" onClick="reloadGo();">&nbsp;&nbsp;
							</c:otherwise>
					</c:choose></th>
            </tr>
		 </table>
	</div>
  </body>
</html>
